%
%
% Ported from http://cgogn.u-strasbg.fr/DocCGoGN/colorMaps_8h_source.html
% color_map_BCGYR(float x)
function [ r ] = color_map_BCGYR( x )
r = zeros(1, 3);
if (x < 0.0)
    r(1,3) = 1.0;
elseif (x < 0.25)
    r(1,1) = 0.0;
    r(1,2) = 4.0 * x;
    r(1,3) = 1.0;
elseif (x < 0.5)
    r(1,1) = 0.0;
    r(1,2) = 1.0;
    r(1,3) = 2.0 - 4.0 * x;
elseif (x < 0.75)
    r(1,1) = 4.0 * x - 2.0;
    r(1,2) = 1.0;
    r(1,3) = 0.0;
elseif (x < 1.0)
    r(1,1) = 1.0;
    r(1,2) = 4.0 - 4.0 * x;
    r(1,3) = 0.0;
else
    r(1,1) = 1.0;
end % if

r = uint8( r * 255 );

end % function

